<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Calico: calico/third_party/apriltags/apriltags/Quad.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Calico
   </div>
   <div id="projectbrief">A visual-inertial calibration library designed for rapid problem construction and debugging.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_e7ac338090e46d594d3ea7a0e9efc7ba.html">calico</a></li><li class="navelem"><a class="el" href="dir_65d747a460e6d1ffaba160a154370ebb.html">third_party</a></li><li class="navelem"><a class="el" href="dir_3db016810d58e96ba2daf796df211604.html">apriltags</a></li><li class="navelem"><a class="el" href="dir_4a25d34b206d743290bd9e525b1db332.html">apriltags</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Quad.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef QUAD_H</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define QUAD_H</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160; </div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;utility&gt;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160; </div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;Eigen/Dense&gt;</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160; </div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;apriltags/Homography33.h&quot;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160; </div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceAprilTags.html">AprilTags</a> {</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keyword">class </span>FloatImage;</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="keyword">class </span>Segment;</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; </div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="keyword">using</span> std::min;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="keyword">using</span> std::max;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="classAprilTags_1_1Quad.html">   20</a></span>&#160;<span class="keyword">class </span><a class="code" href="classAprilTags_1_1Quad.html">Quad</a> {</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="classAprilTags_1_1Quad.html#ae5473d956218448be77f6997796b1ea8">   22</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classAprilTags_1_1Quad.html#ae5473d956218448be77f6997796b1ea8">minimumEdgeLength</a> = 6; </div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="classAprilTags_1_1Quad.html#afeec819e242367c2c400e2c027db0574">   23</a></span>&#160;  <span class="keyword">static</span> <span class="keywordtype">float</span> <span class="keyword">const</span> <a class="code" href="classAprilTags_1_1Quad.html#afeec819e242367c2c400e2c027db0574">maxQuadAspectRatio</a>; </div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;  <a class="code" href="classAprilTags_1_1Quad.html#a61dcb0ff81a8e56a46f8ec8c690c4b15">Quad</a>(<span class="keyword">const</span> std::vector&lt; std::pair&lt;float,float&gt; &gt;&amp; p, <span class="keyword">const</span> std::pair&lt;float,float&gt;&amp; opticalCenter);</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;  std::pair&lt;float,float&gt; <a class="code" href="classAprilTags_1_1Quad.html#af8724a12f12daee93579bae28d4109e0">interpolate</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y);</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;  std::pair&lt;float,float&gt; <a class="code" href="classAprilTags_1_1Quad.html#a8e893f004aee7447396d1939e1a87648">interpolate01</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y);</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; </div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="classAprilTags_1_1Quad.html#a9ef5047c264772f2a3a44f8fd0a18363">   37</a></span>&#160;  std::vector&lt; std::pair&lt;float,float&gt; &gt; <a class="code" href="classAprilTags_1_1Quad.html#a9ef5047c264772f2a3a44f8fd0a18363">quadPoints</a>;</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160; </div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="classAprilTags_1_1Quad.html#afa06de3d6ae8bf4bb670f2b7f8ec4f5f">   40</a></span>&#160;  std::vector&lt;Segment*&gt; <a class="code" href="classAprilTags_1_1Quad.html#afa06de3d6ae8bf4bb670f2b7f8ec4f5f">segments</a>;</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160; </div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="classAprilTags_1_1Quad.html#a26b948b98fdede39e373fabcc3214b7a">   47</a></span>&#160;  <span class="keywordtype">float</span> <a class="code" href="classAprilTags_1_1Quad.html#a26b948b98fdede39e373fabcc3214b7a">observedPerimeter</a>;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="classAprilTags_1_1Quad.html#a3b6590252139460f985375c1a843b94f">   51</a></span>&#160;  <a class="code" href="classHomography33.html">Homography33</a> <a class="code" href="classAprilTags_1_1Quad.html#a3b6590252139460f985375c1a843b94f">homography</a>;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160; </div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;  <span class="comment">/*  @param quads any discovered quads will be added to this list</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="comment">   *  @param path  the segments currently part of the search</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="comment">   *  @param parent the first segment in the quad</span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="comment">   *  @param depth how deep in the search are we?</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="comment">   */</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classAprilTags_1_1Quad.html#af94d37c4ebc2280dcfc37b53cd7afb92">search</a>(<span class="keyword">const</span> <a class="code" href="classAprilTags_1_1FloatImage.html">FloatImage</a>&amp; fImage, std::vector&lt;Segment*&gt;&amp; path,</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;                     <a class="code" href="classAprilTags_1_1Segment.html">Segment</a>&amp; parent, <span class="keywordtype">int</span> depth, std::vector&lt;Quad&gt;&amp; quads,</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;                     <span class="keyword">const</span> std::pair&lt;float,float&gt;&amp; opticalCenter);</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160; </div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="preprocessor">#ifdef INTERPOLATE</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;  Eigen::Vector2f p0, p3, p01, p32;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;};</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;} <span class="comment">// namespace</span></div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160; </div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassAprilTags_1_1FloatImage_html"><div class="ttname"><a href="classAprilTags_1_1FloatImage.html">AprilTags::FloatImage</a></div><div class="ttdoc">Represent an image as a vector of floats in [0,1].</div><div class="ttdef"><b>Definition:</b> FloatImage.h:15</div></div>
<div class="ttc" id="aclassAprilTags_1_1Quad_html"><div class="ttname"><a href="classAprilTags_1_1Quad.html">AprilTags::Quad</a></div><div class="ttdoc">Represents four segments that form a loop, and might be a tag.</div><div class="ttdef"><b>Definition:</b> Quad.h:20</div></div>
<div class="ttc" id="aclassAprilTags_1_1Quad_html_a26b948b98fdede39e373fabcc3214b7a"><div class="ttname"><a href="classAprilTags_1_1Quad.html#a26b948b98fdede39e373fabcc3214b7a">AprilTags::Quad::observedPerimeter</a></div><div class="ttdeci">float observedPerimeter</div><div class="ttdoc">Total length (in pixels) of the actual perimeter observed for the quad.</div><div class="ttdef"><b>Definition:</b> Quad.h:47</div></div>
<div class="ttc" id="aclassAprilTags_1_1Quad_html_a3b6590252139460f985375c1a843b94f"><div class="ttname"><a href="classAprilTags_1_1Quad.html#a3b6590252139460f985375c1a843b94f">AprilTags::Quad::homography</a></div><div class="ttdeci">Homography33 homography</div><div class="ttdoc">Given that the whole quad spans from (0,0) to (1,1) in &quot;quad space&quot;, compute the pixel coordinates fo...</div><div class="ttdef"><b>Definition:</b> Quad.h:51</div></div>
<div class="ttc" id="aclassAprilTags_1_1Quad_html_a61dcb0ff81a8e56a46f8ec8c690c4b15"><div class="ttname"><a href="classAprilTags_1_1Quad.html#a61dcb0ff81a8e56a46f8ec8c690c4b15">AprilTags::Quad::Quad</a></div><div class="ttdeci">Quad(const std::vector&lt; std::pair&lt; float, float &gt; &gt; &amp;p, const std::pair&lt; float, float &gt; &amp;opticalCenter)</div><div class="ttdoc">Constructor.</div><div class="ttdef"><b>Definition:</b> Quad.cc:13</div></div>
<div class="ttc" id="aclassAprilTags_1_1Quad_html_a8e893f004aee7447396d1939e1a87648"><div class="ttname"><a href="classAprilTags_1_1Quad.html#a8e893f004aee7447396d1939e1a87648">AprilTags::Quad::interpolate01</a></div><div class="ttdeci">std::pair&lt; float, float &gt; interpolate01(float x, float y)</div><div class="ttdoc">Same as interpolate, except that the coordinates are interpreted between 0 and 1, instead of -1 and 1...</div><div class="ttdef"><b>Definition:</b> Quad.cc:48</div></div>
<div class="ttc" id="aclassAprilTags_1_1Quad_html_a9ef5047c264772f2a3a44f8fd0a18363"><div class="ttname"><a href="classAprilTags_1_1Quad.html#a9ef5047c264772f2a3a44f8fd0a18363">AprilTags::Quad::quadPoints</a></div><div class="ttdeci">std::vector&lt; std::pair&lt; float, float &gt; &gt; quadPoints</div><div class="ttdoc">Points for the quad (in pixel coordinates), in counter clockwise order. These points are the intersec...</div><div class="ttdef"><b>Definition:</b> Quad.h:37</div></div>
<div class="ttc" id="aclassAprilTags_1_1Quad_html_ae5473d956218448be77f6997796b1ea8"><div class="ttname"><a href="classAprilTags_1_1Quad.html#ae5473d956218448be77f6997796b1ea8">AprilTags::Quad::minimumEdgeLength</a></div><div class="ttdeci">static const int minimumEdgeLength</div><div class="ttdoc">Minimum size of a tag (in pixels) as measured along edges and diagonals.</div><div class="ttdef"><b>Definition:</b> Quad.h:22</div></div>
<div class="ttc" id="aclassAprilTags_1_1Quad_html_af8724a12f12daee93579bae28d4109e0"><div class="ttname"><a href="classAprilTags_1_1Quad.html#af8724a12f12daee93579bae28d4109e0">AprilTags::Quad::interpolate</a></div><div class="ttdeci">std::pair&lt; float, float &gt; interpolate(float x, float y)</div><div class="ttdoc">Interpolate given that the lower left corner of the lower left cell is at (-1,-1) and the upper right...</div><div class="ttdef"><b>Definition:</b> Quad.cc:37</div></div>
<div class="ttc" id="aclassAprilTags_1_1Quad_html_af94d37c4ebc2280dcfc37b53cd7afb92"><div class="ttname"><a href="classAprilTags_1_1Quad.html#af94d37c4ebc2280dcfc37b53cd7afb92">AprilTags::Quad::search</a></div><div class="ttdeci">static void search(const FloatImage &amp;fImage, std::vector&lt; Segment * &gt; &amp;path, Segment &amp;parent, int depth, std::vector&lt; Quad &gt; &amp;quads, const std::pair&lt; float, float &gt; &amp;opticalCenter)</div><div class="ttdoc">Searches through a vector of Segments to form Quads.</div><div class="ttdef"><b>Definition:</b> Quad.cc:52</div></div>
<div class="ttc" id="aclassAprilTags_1_1Quad_html_afa06de3d6ae8bf4bb670f2b7f8ec4f5f"><div class="ttname"><a href="classAprilTags_1_1Quad.html#afa06de3d6ae8bf4bb670f2b7f8ec4f5f">AprilTags::Quad::segments</a></div><div class="ttdeci">std::vector&lt; Segment * &gt; segments</div><div class="ttdoc">Segments composing this quad.</div><div class="ttdef"><b>Definition:</b> Quad.h:40</div></div>
<div class="ttc" id="aclassAprilTags_1_1Quad_html_afeec819e242367c2c400e2c027db0574"><div class="ttname"><a href="classAprilTags_1_1Quad.html#afeec819e242367c2c400e2c027db0574">AprilTags::Quad::maxQuadAspectRatio</a></div><div class="ttdeci">static float const maxQuadAspectRatio</div><div class="ttdoc">Early pruning of quads with insane ratios.</div><div class="ttdef"><b>Definition:</b> Quad.h:23</div></div>
<div class="ttc" id="aclassAprilTags_1_1Segment_html"><div class="ttname"><a href="classAprilTags_1_1Segment.html">AprilTags::Segment</a></div><div class="ttdoc">Represents a line fit to a set of pixels whose gradients are similiar.</div><div class="ttdef"><b>Definition:</b> Segment.h:10</div></div>
<div class="ttc" id="aclassHomography33_html"><div class="ttname"><a href="classHomography33.html">Homography33</a></div><div class="ttdoc">Compute 3x3 homography using Direct Linear Transform.</div><div class="ttdef"><b>Definition:</b> Homography33.h:41</div></div>
<div class="ttc" id="anamespaceAprilTags_html"><div class="ttname"><a href="namespaceAprilTags.html">AprilTags</a></div><div class="ttdef"><b>Definition:</b> Edge.h:8</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
